package com.seculab.admin.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.seculab.admin.dao.DefaultDAO;
import com.seculab.admin.domain.User;

@Service
public class UserServiceImpl implements UserService {
	
	@Autowired
	private DefaultDAO defaultDAO;
	
	@Override
	public List getUserList(User user) throws Exception {
		return defaultDAO.selectList("User.getListUser", user);
	}
	
	@Override
	public void addUser(User user) throws Exception {
		defaultDAO.insert("User.addUser", user);
	}	

	@Override
	public User getUser(String id) throws Exception {
		return (User)defaultDAO.selectOne("User.getUser", id);
	}

	@Override
	public void modifyUser(User user) throws Exception {
		defaultDAO.update("User.modifyUser", user);
	}

}
